//
//  ViewController.swift
//  背景理论柯里化
//
//  Created by app on 2017/4/21.
//  Copyright © 2017年 app. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let i = add1(x: 10, y: 1)
        print(i)
        let a = add2(x: 10)(1)
        print(a)


    }
    
    func add1(x: Int, y: Int) -> Int {
        return x + y
    }
    
    func add2(x: Int) -> ((Int) -> Int) {
        return {y in
            return  x + y
        }
    }

}

